import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      redirect: '/movie',
      children: [
        {
          path: 'movie',
          name: 'movie',
          component: () => import('@/views/movie/MovieView.vue'),
        },
      ],
    },
    {
      path: '/movie/:movieId',
      name: 'MovieDetail',
      props: true,
      component: () => import('@/views/movie/MovieDetailView.vue'),
    },
    {
      path: '/movie/:movieId/credits',
      name: 'MovieCredits',
      props: true,
      component: () => import('@/views/movie/MovieCreditsView.vue'),
    },
    {
      path: '/movie/:movieId/preview',
      name: 'MoviePreview',
      props: true,
      component: () => import('@/views/movie/MoviePreviewView.vue'),
    },
    {
      path: '/movie/:movieId/cast/:castId',
      name: 'MovieCastList',
      props: true,
      component: () => import('@/views/movie/MovieCastList.vue'),
    },
    {
      path: '/movie/:movieId/photos/',
      name: 'MoviePhotosList',
      props: true,
      component: () => import('@/views/movie/MoviePhotosList.vue'),
    },
    {
      path: '/cinema/movie/:movieId',
      name: 'BuyTicket',
      props: true,
      component: () => import('@/views/movie/BuyTicketView.vue'),
    },
    {
      path: '/cityList',
      name: 'cityList',
      component: () => import('@/views/city/CityListView.vue'),
    },
    {
      path: '/search',
      name: 'search',
      component: () => import('@/views/search/SearchView.vue'),
    },
    {
      path: '/searchList/:searchType',
      name: 'searchList',
      props: true,
      component: () => import('@/views/search/SearchList.vue'),
    },
    {
      path: '/cinema/:cinemaId',
      name: 'cinemaDetail',
      props: true,
      component: () => import('@/views/cinema/CinemaDetailView.vue'),
    },

    {
      path: '/video',
      name: 'VideoView',
      component: () => import('@/views/video/VideoView.vue'),
    },
    {
      path: '/video/:videoId',
      name: 'VideoDetailView',
      props: true,
      component: () => import('@/views/video/VideoDetailView.vue'),
    },
    {
      path: '/clip',
      name: 'ClipView',
      component: () => import('@/views/clip/ClipView.vue'),
    },
    {
      path: '/clip/:clipId',
      name: 'ClipDetailView',
      props: true,
      component: () => import('@/views/clip/ClipDetailView.vue'),
    },

  ],
})

export default router
